package com.tulingxueyuan.mall.config;



import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "9021000137648033";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCE2fnfdkMiq5XsdajQbQuCTsGL45gn+yepgOyiIzX5gjPv/TPeQICsLAMBzklupx4eFnNPwchAhqlcwJojFXH1XNePiiTcFoT6YVHzao5tSGl8F++ORfFaXGd3Zk61k1Ql+x78YetbU4PNJt1EkWkKqAHCw9Cz+TMsDiZikI20Fxv58zZAvvu+DBqpHSheqPIe83TRR616HwIzfzNfMfUjIm/Ch7TRutzbY4l9qHPIyAknHDxHS8WIp04z4CLmyUodVvitVM/zcc/RRd4qxXm53HkLc90wBK3InAiZyVyaHX7h+XXCPHx60hvbaumE9N81BihfNzolXu3wo9XgtFApAgMBAAECggEAZv3xmAq/20X4cZt5pzOSY5AYvhFQaVZtFhxr1vrDIk6NYzUBnACXgGKSZjj9dro6QAsZlDBfxZ5f+Bccp6w9b4FtX8sx7inLJ6yA8tud1Rz5IgoQXlTc2jeewtLenCe+ab938yMaae+h006Y5Upxi6BZ1RsnVg8QW8wQeAMmyACnmutuKG5p8FYhXm/4ok049gfuoSm1U7bO1K6WHjW4cDyHpm1r+M8aXpZ5N9Vb+NEBZXgVOgWbExXwzBXeOeRQ+6YPNbnigqVoC1dsd+JVJAUYUjVkbNpnMBKVW2lIr/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X6m/EL6VvIvbbLFYK1mDmfmtxYWQMTqcEbZHHsGgs5xftjvsZCJyxyYvU0i1wKBgQClRZbgJJs1UZBS5GBnQxr7E3uO+DGr4sx+ghdKIqC3rRFCDPi34cIfeJ/SlTFGFOA87T4v6yiH4zfQx2u7mLfWNY/zjw3zWMJUamDx3YHmgygG5c6RwlHV6It5v6rnVv/ZHsTrSgwnjvlGjblIn6C7P4uD1w+ndxq6g9fYfu6CYw==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkpuW8kXP/S6KB9gfS+F1l8wEL3x59KX6m32BeaoBR5CQO3Xao02FQknKcocUhVvNtxx6NcQbsVgBvCrpfFIYc0cNPbjfSLeyNoEZmf/6CUM625xZe8NawGaZt8KJuNk5ARQc6ircpcZS5U98kBGmop3Fr8ONbBz/ogMefq43z7Kcrj79PBM0NsaY13bEIeCDfoRzp7YcUzK/lPI7UZPicPEKNHzjLTU6I5KfjU+W7OpB1k5hMnomYHuW+AZy4bax6Gihhf7WEbcjYr9NTfN5daLNxcb/v7HsHE34BDBxYvynXgtxxyLED2UtMrnD9lAhqtK7MV2po3B993sdwcRCzQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://tulingmall.free.idcfengye.com/ali/notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://tulingmall.free.idcfengye.com/ali/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

